// node中发送请求
let http = require('http')

let client = http.request({
  hostname: 'localhost',
  method: 'POST',
  port: 3000,
  headers: {
    a: 1
  }  
}, (response)=>{
  // 返回的结果 是一个可读流
  // console.log(response)
  let arr = []
  response.on('data', (chunk)=>{
    arr.push(chunk)
  })

  response.on('end', ()=>{
    let buffer = Buffer.concat(arr)
    console.log(buffer.toString())
  })

})
// 是一个可写流
client.end('name=fbk')
